﻿using Minotaur.App.Domains.Model.Menu;
using Minotaur.App.Domains.Model.Personal;

namespace Minotaur.App.Domains.Model.Role
{
    [SugarTable("roleinfo")]
    public class RoleInfo : EntityBase
    {
        [SugarColumn(ColumnName = "autoid", IsIdentity = true, IsPrimaryKey = true)]
        public virtual long AutoId { get; set; }

        [SugarColumn(ColumnName = "code")]
        public virtual string? Code { get; set; }

        [SugarColumn(ColumnName = "enable")]
        public virtual bool Enable { get; set; }

        [SugarColumn(ColumnName = "sequence")]
        public virtual double? Sequence { get; set; }
        /// <summary>
        /// 人员
        /// </summary>
        [Navigate(typeof(RoleEmployeeInfo), nameof(RoleEmployeeInfo.RoleId), nameof(RoleEmployeeInfo.EmpId))]//注意顺序
        public virtual List<Employee> Employees { get; set; }

        /// <summary>
        /// 人员
        /// </summary>
        [Navigate(typeof(MenuRole), nameof(MenuRole.RoleId), nameof(MenuRole.MenuId))]//注意顺序
        public virtual List<MenuInfo> Menus { get; set; }

        /// <summary>
        /// 权限
        /// </summary>
        [Navigate(typeof(RolePermission), nameof(RolePermission.RoleId), nameof(RolePermission.PermissionId))]//注意顺序
        public virtual List<Permission.Permission> Permissions { get; set; }
    }
}
